﻿<%@ Page Language="C#" MasterPageFile="~/System/System.master" AutoEventWireup="true"
    CodeFile="CodeItemList.aspx.cs" Inherits="System_CodeItemList" Title="无标题页" StylesheetTheme="Content" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script type="text/javascript">
        //<![CDATA][
        function CheckAll(oCheckbox) {
            var items = document.getElementsByTagName("INPUT");
            for (i = 0; i < items.length; i++) {
                if (items[i].type == "checkbox") {
                    items[i].checked = oCheckbox.checked;
                }
            }
        }
        //]]>
    </script>

    <ul class="topmenu">
        <li>
            <asp:DropDownList ID="CodeGroup" runat="server" 
                DataTextField="GroupName" DataValueField="GroupID" AutoPostBack="True" 
                onselectedindexchanged="CodeGroup_SelectedIndexChanged">
            </asp:DropDownList>
        </li>
        <li><a href="CodeItemNew.aspx">添加</a></li>
        <li>
            <asp:LinkButton ID="ButtonEdit" runat="server" OnClick="ButtonEdit_Click">编辑</asp:LinkButton></li>
        <li>
            <asp:LinkButton ID="ButtonDelete" runat="server" OnClick="ButtonDelete_Click">删除</asp:LinkButton></li>
    </ul>
    <asp:GridView ID="UserGrid" runat="server" AutoGenerateColumns="False" Caption="<span>编码列表</span>"
        DataKeyNames="ID" OnRowDataBound="UserGrid_RowDataBound">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <input id="ChkAll" type="checkbox" onclick="CheckAll(this)" runat="server" title="全选/取消" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="CheckItem" runat="server" />
                </ItemTemplate>
                <HeaderStyle Width="20px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ItemID" HeaderText="编码">
                <HeaderStyle Width="120px" HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="编码名称">
                <ItemTemplate>
                    <a title='<%# Eval("Description") %>'>
                        <%# GetItemName(Eval("ItemName").ToString(), (int)Eval("ItemLevel"))%></a>
                </ItemTemplate>
                <HeaderStyle Width="240px" HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:BoundField DataField="SeqID" HeaderText="序号">
                <HeaderStyle Width="24px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Description" HeaderText="描述"></asp:BoundField>
        </Columns>
    </asp:GridView>
    <div style="padding: 4px;">
        <div style="float: left">
            <asp:Label ID="lbGridInfo" runat="server"></asp:Label>
        </div>
        <div style="float: right">
            <asp:LinkButton ID="btnFirst" runat="server" CommandArgument="First" CommandName="Page"
                OnClick="btnFirst_Click">首页</asp:LinkButton>
            <asp:LinkButton ID="btnPrev" runat="server" CommandArgument="Prev" CommandName="Page"
                OnClick="btnPrev_Click">上一页</asp:LinkButton>
            <asp:LinkButton ID="btnNext" runat="server" CommandArgument="Next" CommandName="Page"
                OnClick="btnNext_Click">下一页</asp:LinkButton>
            <asp:LinkButton ID="btnLast" runat="server" CommandArgument="Last" CommandName="Page"
                OnClick="btnLast_Click">末页</asp:LinkButton>
            转到：第
            <asp:DropDownList ID="JumpList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="JumpList_SelectedIndexChanged">
            </asp:DropDownList>
            页
        </div>
    </div>
    <div class="clear">
    </div>
    <div class="prompt">
        <asp:Label ID="Prompt" runat="server"></asp:Label></div>
</asp:Content>
